package com.zygh.policeasset.mapper;

import com.zygh.policeasset.pojo.Company;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.type.JdbcType;

@Mapper
/* loaded from: police-asset-2.0-0.0.1-SNAPSHOT.jar:BOOT-INF/classes/com/zygh/policeasset/mapper/CompanyMapper.class */
public interface CompanyMapper {
    @Delete({"delete from company where id = #{id,jdbcType=INTEGER}"})
    int delete(Integer num);

    @Insert({"insert into company (company_name,note) ", "values (#{companyName,jdbcType=VARCHAR},#{note,jdbcType=VARCHAR})"})
    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    int add(Company company);

    @Select({"<script>", "select id, company_name, note from company <where><if test='companyName != null and companyName.length &gt; 0'> company_name = #{companyName} </if></where></script>"})
    @Results({@Result(column = "id", property = "id", jdbcType = JdbcType.INTEGER, id = true), @Result(column = "company_name", property = "companyName", jdbcType = JdbcType.VARCHAR), @Result(column = "note", property = "note", jdbcType = JdbcType.VARCHAR)})
    List<Company> findAll(@Param("companyName") String str);

    @Select({"select id, company_name, note ", "from company ", "where company_name like '%公司%' "})
    @Results({@Result(column = "id", property = "id", jdbcType = JdbcType.INTEGER, id = true), @Result(column = "company_name", property = "companyName", jdbcType = JdbcType.VARCHAR), @Result(column = "note", property = "note", jdbcType = JdbcType.VARCHAR)})
    List<Company> findByCp();

    @Select({"<script>", "select id, company_name, note ", "from company ", "<where><if test='id != null and id != 0'>and id = #{id} </if></where></script>"})
    @Results({@Result(column = "company_name", property = "companyName", jdbcType = JdbcType.VARCHAR)})
    List<Company> findById(@Param("id") Integer num);

    @Update({"update company set company_name = #{companyName,jdbcType=VARCHAR},note = #{note,jdbcType=VARCHAR} ", "where id = #{id,jdbcType=INTEGER}"})
    int update(Company company);

    @Select({"<script>", "select id, company_name, note from company ", "where company_name = #{companyName} <if test='id != null and id &gt; -1'>and id != #{id} </if></script>"})
    Company getAdd(@Param("companyName") String str, @Param("id") int i);
}